<?php
/**
 * Created by PhpStorm.
 * Adminuser: ERHAO
 * Date: 2018/10/29
 * Time: 10:20
 */
namespace app\index\controller;
use think\Controller;
use think\Db;
class Basic extends Controller
{
    public function _initialize()
    {
        $o =new \SaeTOAuthV2(WB_AKEY , WB_SKEY);
        $code_url=$o->getAuthorizeURL(WB_CALLBACK_URL);
        $this->assign('url',$code_url);
        $this->nav();
        $this->common();
    }
    public function nav(){
        $cate=Db::table('category')->where('status',1)->select();
        $this->assign('cate',$cate);
    }
    public function common(){
        $data=Db::table('link')->where('status',1)->select();
        $this->assign('data',$data);
        $article=Db::table('article')->where('status',1)->order('id','desc')->limit(0,8)->select();
        $this->assign('article',$article);
    }
}